cmake_minimum_required(VERSION 3.24)

project(trial_cmake LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_executable(${PROJECT_NAME} main.cpp)

if(${THIRD_PARTY_MODE} STREQUAL "git submodule")
  add_subdirectory(third_party)
endif()

# Generate CTestTestfile.cmake in current and sub build folders,
# with it the command `ctest` can work
enable_testing()

# Add a general ctest
add_test(NAME trial_cmake_test COMMAND ${PROJECT_NAME})

add_subdirectory(tests)
